typedef unsigned char 	U8;
typedef unsigned int 	U16;

/************OLED IO Defination**************/
//PORTBbit_15  	= 	Reset
//PORTDbit_4  	= 	WR
//PORTDbit_5  	= 	RD
//PORTDbit_11  	= 	CS
//PORTBbit_14  	= 	CMD

#define OLED_COMMAND 		mPORTBClearBits(BIT_14);
#define OLED_DATA	 		mPORTBSetBits(BIT_14);

#define CS_ENABLE 			mPORTDClearBits(BIT_11);
#define CS_DISABLE 			mPORTDSetBits(BIT_11);

#define RD_ENABLE 			mPORTDClearBits(BIT_5);
#define RD_DISABLE 			mPORTDSetBits(BIT_5);

#define WD_ENABLE 			mPORTDClearBits(BIT_4);
#define WD_DISABLE 			mPORTDSetBits(BIT_4);

#define RESET_ENABLE 		mPORTBClearBits(BIT_15);
#define RESET_DISABLE 		mPORTBSetBits(BIT_15);



/***********OLED register defination***********/
#define rOSC_CTL					0x02
#define rCLOCK_DIV					0x03
#define rREDUCE_CURRENT				0x04
#define rDISP_ON_OFF				0x06
#define rPRECHARGE_TIME_R			0x08
#define rPRECHARGE_TIME_G			0x09
#define rPRECHARGE_TIME_B			0x0A
#define rPRECHARGE_Current_R		0x0B
#define rPRECHARGE_Current_G		0x0C
#define rPRECHARGE_Current_B		0x0D
#define rDRIVING_CURRENT_R			0x10
#define rDRIVING_CURRENT_G			0x11
#define rDRIVING_CURRENT_B			0x12
#define rDISPLAY_MODE_SET			0x13
#define rRGB_IF						0x14
#define rMEMORY_WRITE_MODE			0x16
#define rMX1_ADDR					0x17
#define rMX2_ADDR					0x18
#define rMY1_ADDR					0x19
#define rMY2_ADDR					0x1A
#define rMEMORY_ACCESS_POINTER_X	0x20
#define rMEMORY_ACCESS_POINTER_Y	0x21
#define rDDRAM_DATA_ACCESS_PORT		0x22
#define rDUTY						0x28
#define rDSL						0x29
#define rD1_DDRAM_FAC				0x2E
#define rD1_DDRAM_FAR				0x2F
#define rD2_DDRAM_SAC				0x31
#define rD2_DDRAM_SAR				0x32
#define rSCR1_FX1					0x33
#define rSCR1_FX2					0x34
#define rSCR1_FY1					0x35
#define rSCR1_FY2					0x36
#define rSCR2_SX1					0x37
#define rSCR2_SX2					0x38
#define rSCR2_SY1					0x39
#define rSCR2_SY2					0x3A
#define rSCREEN_SAVER_CONTEROL		0x3B
#define rSCREEN_SAVER_MODE			0x3D
#define rSS_SCR1_FU	     			0x3E
#define rSS_SCR1_MXY				0x3F
#define rSS_SCR2_FU					0x40
#define rSS_SCR2_MXY				0x41
#define rSS_SCR2_SX1				0x47
#define rSS_SCR2_SX2				0x48
#define rSS_SCR2_SY1				0x49
#define rSS_SCR2_SY2				0x4A
#define rIREF						0x80



extern  U8 OLED_CursorX;
extern  U8 OLED_CursorY;
extern  U8 OLED_Red;
extern  U8 OLED_Green;
extern  U8 OLED_Blue;


void    OLED_Puts           	( char * pString );
void 	OLED_Putc				( U8 ch );
void    OLED_Set_Color       	( U8 R, U8 G, U8 B);


